﻿using UnityEngine;
using System;
using System.Collections;

namespace Hont.C2UTool
{
    public class AnimationInfoGeneralAnalyzer : IC2UAnimationInfoAnalyzer
    {
        public int Priority { get { return 1; } }

        public C2UStructs.AnimationInfoStruct AnalyzeExecute(string gameObjectPath, string typeName, string propName)
        {
            var result = new C2UStructs.AnimationInfoStruct();

            result.Path = gameObjectPath;
            result.Type = C2UUtility.GetRuntimeType(typeName);
            result.Property = propName;
            return result;
        }

        public void ApplyToTarget(C2UStructs.AnimationInfoStruct info, AnimationClip clip, AnimationCurve curve)
        {
            clip.SetCurve(info.Path, info.Type, info.Property, curve);
        }

        public bool CanSlover(Type targetType, string propName)
        {
            return true;
        }
    }
}
